package sample.akka.demo

import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global

object Demo extends App {
  val x = promise[Int]      // Promise只能设置一次，之后会报异常
  val y = x.future

  println(y.isCompleted)

  x success 5
  println(y.isCompleted)
  println(s"y.value: ${y.value}")

  x success 7
  println(s"y.value : ${y.value}")

}
